<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fet.redeem.model.Gift"%>
<%@ page import="com.fet.redeem.model.Customer"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	List<Gift> giftList = (List<Gift>)request.getAttribute("giftList");
	Customer customer = (Customer)request.getAttribute("customer");
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'giftList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  		<div style="font:italic bold 20px arial,sans-serif;"><%=customer.getName() %>可兑换礼品：</div>
    	<table border="1">
    		<tr>
    			<th>id</th>
    			<th>name</th>
    			<th>price</th>
    		</tr>
    		<%
    			if(giftList != null && giftList.size() > 0){
    				for(Gift gift:giftList){
    		 %>
    		<tr>
    			<td><%=gift.getId() %></td>
    			<td><%=gift.getName() %></td>
    			<td><%=gift.getPrice() %></td>
    		</tr>
    		<%
    				}
    			}else{
    		 %>
    		 <tr>
    		 	<td>&nbsp;</td>
    		 	<td>&nbsp;</td>
    		 	<td>&nbsp;</td>
    		</tr>
    		 <%
    		   }
    		  %>
    	</table>
  </body>
</html>
